home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / VideoToolbox 96.06.15 / (Notes) / cscSetModeTiming.doc < prev    next >
Internet Message Format  |  1995-04-13  |  19KB

  1. From: Denis Pelli (3/17/1995)
  2. To:   Apple Developer Support,   Apple PCI Bus Development
  3. CC: David Nagel
  4. Subject:Video Drivers            5:06 PM        3/17/1995
  5. March 17, 1995
  6.  
  7. Dear Apple,
  8.  
  9. We, the 41 undersigned visual scientists [and another ten who endorsed the
  10. letter after it was sent], are writing to suggest the addition of a new
  11. "cscSetModeTiming" video driver control call to the "Display Driver Calls"
  12. chapter of "Designing PCI Cards & Drivers".
  13.  
  14. THE NEED:
  15.  
  16. Today's video cards and monitors are mostly capable of running with a
  17. practically infinite range of resolutions and field rates (timings).
  18. Current MacOS software, recently enhanced by the addition of the Display
  19. Manager, restricts this infinite spectrum to a short list of modes
  20. (timings) specified in the video card's ROM and driver. This creates a
  21. perennial compatibility problem as old video cards cannot drive new
  22. displays with unanticipated timings. (In principle a new driver could be
  23. installed, but this would require writing a new driver for each video
  24. card that is to support the new display, which is impractical.) New
  25. display devices--LCD, projection, HDTV, stereo, etc.--are coming and it
  26. seems likely that they will function best with new timings that are hard
  27. to anticipate today.
  28.  
  29. One of the best ways of generating stereo imagery (for virtual reality
  30. and cyberspace) is to double the monitor's frame rate (e.g. to 134 Hz)
  31. and to use LCD glasses that allow each eye to see alternate frames. Many
  32. commercially available video monitors will run at such high frame rates,
  33. but, alas, most Mac video drivers have no provision for it, even though
  34. the video card is capable.
  35.  
  36. The availability of custom timings would provide a new opportunity
  37. for game developers. Games often achieve exciting effects by pushing the
  38. hardware to its limits. Some very interesting effects could be generated
  39. by smoothly changing the timing from spatially coarse high frame rate
  40. images for fast motion sequences to spatially fine temporally slow (e.g.
  41. 67 Hz) frame rates for intricate imagery.
  42.  
  43. Many vision studies require high frame rates, over 100 Hz, in order to
  44. study stereo, motion perception, and retinal phenomena without
  45. artifacts. Many monitors and most video cards would run happily at such
  46. high frame rates, but hardly any of today's Mac video drivers will allow
  47. it.
  48.  
  49. TESTIMONIALS TO THE NEED:
  50.  
  51. Patrick Cavanagh, patrick@burrhus.harvard.edu, writes "High-frame-rate
  52. video cards are available for the PC, typically for stereo. None are
  53. available for the Mac. Many of us and those in computer graphics are
  54. being forced to the PC market because of this oversight."
  55.  
  56. James Dinunzio, dinunzio@scf.usc.edu, writes, "Hi. I am a graduate
  57. student at University of Southern Cal in the Computer Science
  58. Department. I am a member of a newly formed group working under faculty
  59. dedicated to graphics and virtual reality. I am currently working on a
  60. project to produce decent stereopsis on the Macintosh, including still
  61. stereo images, movies, and if possible "live" walkthroughs. I will be
  62. using a pair of LCD shutter glasses controlled through the serial port
  63. and running at a nominal 30 fps, 60fps for both eyes. ... Any
  64. suggestions?"
  65.  
  66. Tom Busey, busey@indiana.edu, adds, "I have just finished writing code
  67. that displays color stereo 3-d pairs for use with LCD glasses. This code
  68. uses sequential-frame presentations synched with LCD glasses controlled
  69. via the serial port to provide the illusion of depth. While this
  70. technology is old, what is new is my code that takes two pict files and
  71. reduces the colors from millions of colors to what amounts to 4 bits per
  72. red, green and blue channel for each picture (on monitors with millions
  73. of colors) or 2 bits per channel for monitors with thousands of colors.
  74. The two pictures are then added together and then I use clut switching
  75. to switch between the two pictures. The stereo 3-d code uses calls from
  76. (not surprisingly) the VideoToolbox code library [described below]. As
  77. with all the code I write, this code is freely available to anyone who
  78. wants it. I'm currently working with LCD glasses distributors to have it
  79. distributed free to purchasers of LCD glasses. It may be downloaded
  80. from:"
  81. ftp://ftp.psych.indiana.edu/pub/busey/AdjustStereoPicts.sea.hqx
  82.  
  83. "The bottom line is that this approach makes virtual reality a (virtual)
  84. reality on macs, for very low cost (about $150 for the glasses, plus
  85. some parts for a very simple interface). However, because of the
  86. relatively slow frame rate of my 2-page monitor (67 hz), I am only
  87. getting about 33 images per eye per second. This causes visible flicker,
  88. and I would love to be able to increase the frame rate to 120 hz. Such
  89. an increase would not only reduce the flicker, but it would also make
  90. the glasses and the mac research-grade for doing experiments. Thus I
  91. support your call for Apple to add an adjustable frame rate option."
  92.  
  93. [The following testimonials were received after the original
  94. letter was sent. 3/22/95]
  95.  
  96. Mats Lind,  mats.lind@cmd.uu.se, writes, "3-D Max, a Swedish company,
  97. working with a Korean supplier, has just started to deliver attractively
  98. priced LCD-shutter glasses and accessories giving binocular stereo
  99. capabilities to PCs. Their product received enormous attention at the
  100. Ce-Bit fair in Hannover last week. The estimated retail price in the US
  101. will be less than 180 USD (including some extra software like 3-D games)
  102. and will probably reach a high market share. 3-D Max, is very interested
  103. in entering the Apple market segment as well, but to do so requires the
  104. usual 120+ Hz."
  105.  
  106. Chris Tyler, cwt@skivs.ski.org, writes, "We are using the VideoToolbox
  107. to develop a two-monitor stereo display system. We would be delighted
  108. to know of calls that could control the raster rates and video card
  109. synchronization. I think that I can speak for many investigators at the
  110. Smith-Kettlewell Institute, which probably owns about 50 Macintoshes,
  111. that the features you propose would be of great value to many."
  112.  
  113. FIVE SUGGESTIONS TO APPLE:
  114.  
  115. We suggest the following additions to the "Display Driver Calls" chapter
  116. of "Designing PCI Cards & Drivers".
  117.  
  118. 1. (MAJOR) Add a cscSetModeTiming control call to the repertoire for
  119. video drivers to allow specification of an arbitrary new timing.
  120.  
  121. Using an extended VDTimingInfoRec struct, or perhaps an entirely new
  122. struct, the calling program would specify the desired timing (i.e. pixel
  123. rate, line rate, field rate, frame synch width, frame front porch, frame
  124. back porch, frame synch polarity, line synch width, line front porch,
  125. line back porch, line synch polarity, synch on green (y/n), combined
  126. synch polarity, and interlaced/noninterlaced, as well as the desired
  127. rowBytes and page [oops, I meant "pageBytes"]) and issue a
  128. cscSetModeTiming control call to the video driver. In response, the
  129. video driver would change the mode to comply, as nearly as possible,
  130. with the request, and, before returning, would update the caller's
  131. struct to reflect the achievable timing. The driver would also be
  132. responsible for updating the mode's other derivative specifications
  133. (bounds rect, etc.) that are used by other control and status calls
  134. (e.g. cscSwitchMode, cscGetPages, cscGetModeTiming,
  135. cscGetNextResolution, cscGetVideoParams). The effect of this change
  136. should be persistent, lasting at least until shut down.
  137.  
  138. (Timing changes that do not affect rowBytes would not require calling
  139. the Display Manager to repaint the screen, so most timing transitions
  140. could be done smoothly, without any visible glitches. The application
  141. would typically call DMSetDisplayMode only at the end of the special
  142. effect, mainly to update the bounds rect.)
  143.  
  144. (cscSetModeTiming is a powerful call that could create timings that
  145. would not effectively drive the monitor, and might even harm it.
  146. However, this power can be accessed only through a Control call to the
  147. driver, and thus is inaccessible to the casual user. We would expect it
  148. to be used only by applications written by the monitor manufacturers and
  149. developers of games and virtual reality environments and other
  150. special-effects applications.)
  151.  
  152. cscSetModeTiming would allow an application run at start up to customize
  153. ANY video card (whose driver supports the call) to drive a novel
  154. display, or drive an old display at novel timings. The new timing would
  155. persist until shut down or restart.
  156.  
  157. 2. (MINOR) It would be helpful to enhance the corresponding
  158. cscGetModeTiming status call to return the same timing info.
  159.  
  160. 3. (MINOR) Please add a trivial cscGetVBLBitAddress status call to
  161. return the location of the VBL bit. As far as we know, every Mac video
  162. device has a VBL bit, somewhere, that is true only during blanking.
  163. Unfortunately there is no easy way to find it. For many special effects
  164. it is necessary to synchronize multiple video monitors. Since every
  165. video card insists on being a master, and they have independent clocks,
  166. monitors normally run asynchronously of one another. In the past we've
  167. used custom hardware and software tricks, specific to particular video
  168. cards, to reset multiple cards at once, or to halt the clock on one
  169. until it drifts into phase with another. A better, general, solution
  170. would be to use cscSetModeTiming to tweak the timing of one video card
  171. relative to the other until they come into synch. However, to do this,
  172. we need to be able to continuously monitor the VBL bit of each device.
  173. (Using a VBL interrupt service routine to set a bit at a known location
  174. is much less satisfactory because of the extra uncertainty in timing and
  175. because this gives us only the time of onset of VBL, denying us access
  176. to the time of offset.)
  177.  
  178. 4. (VERY MINOR) We'd like to request that a clarification be added to
  179. the documentation of the cscSetGray control call. Most video drivers
  180. implement this call correctly. However, a few video drivers (e.g.
  181. PowerMac 7100 vram driving an Apple 2-page monochrome monitor, and the
  182. Radius PrecisionColor 8 and 8Xj driving a Radius 2-page monochrome
  183. monitor), upon detecting the presence of a monochrome video monitor,
  184. lock themselves into the monochrome state (i.e. always do luminance
  185. mapping) irrespective of calls to cscSetGray. The cscSetGray calls
  186. return without error and calls to cscGetGray misleadingly imply that the
  187. mono/color mode is being changed, but the driver stubbornly continues to
  188. do luminance mapping. This prevents us from using some very useful
  189. special effects that depend on having full control of the CLUT (i.e.
  190. color mode) while driving a monochrome display (see Pelli & Zhang,
  191. 1991). Please tell the developers of video drivers not to get tricky:
  192. don't disable cscSetGray.
  193.  
  194. 5. (VERY MINOR) A surprisingly large number of video drivers (e.g. Mac
  195. IIci Built-In Video, Relax 19" Model 200) fail to correctly implement
  196. cscGetEntries, even though it is a required status call. Perhaps a
  197. sentence could be added to the documentation of cscGetEntries, advising
  198. developers to perform a write-then-read (cscSetEntries & cscGetEntries)
  199. test of their new driver before releasing it to the world. (TimeVideo,
  200. described below, does this test, which revealed the bugs.)
  201.  
  202. Denis Pelli
  203. Apple Partner
  204. Professor of Neuroscience at Syracuse University
  205. denis_pelli@isr.syr.edu
  206.  
  207. Kenneth R. Alexander
  208. Eye and Ear Infirmary
  209. University  of Illinois
  210. kennalex@tigger.cc.uic.edu
  211.  
  212. Michael Bach
  213. Dept. of Ophthalmology
  214. University of Freiburg
  215. Germany
  216. bach@sun1.ruf.uni-freiburg.de
  217.  
  218. Martin S. Banks
  219. School of Optometry
  220. UC Berkeley
  221. marty@john.berkeley.edu
  222.  
  223. Paul Beckmann
  224. Psychology Department
  225. University of Minnesota
  226. paul@eye.psych.umn.edu
  227.  
  228. Patrick Bennett
  229. Psychology Department
  230. University of Toronto
  231. bennett@psych.utoronto.ca
  232.  
  233. Margaret Bradley
  234. NIMH Center for the Study of Emotion and Attention
  235. University of Florida.
  236. BRADLEY@nervm.nerdc.ufl.edu
  237.  
  238. David Brainard
  239. Psychology Department
  240. UC Santa Barbara
  241. brainard@condor.psych.ucsb.edu
  242.  
  243. Catherine Burns
  244. Institute for Sensory Research
  245. Syracuse University
  246. katey_burns@isr.syr.edu
  247.  
  248. Tom Busey
  249. Department of Psychology
  250. Indiana University
  251. busey@indiana.edu
  252.  
  253. Patrick Cavanagh
  254. Psychology Department
  255. Harvard University
  256. patrick@burrhus.harvard.edu
  257.  
  258. Frans W. Cornelissen
  259. Laboratory for Experimental Ophthalmology
  260. Center for Behavioural, Cognitive and Neurosciences
  261. University of Groningen
  262. The Netherlands
  263. f.w.cornelissen@bcn.rug.nl
  264.  
  265. Andrew Derrington
  266. Psychology Dept
  267. Nottingham University
  268. UK
  269. Andrew.Derrington@nott.ac.uk
  270.  
  271. Michael P. Eckert
  272. School of Electrical Engineering
  273. University of Technology, Sydney
  274. Australia
  275. meckert@ee.uts.edu.au
  276.  
  277. Rhea T. Eskew, Jr.
  278. Dept. of Psychology
  279. Northeastern University
  280. eskew@neu.edu
  281.  
  282. Bart Farell
  283. Institute for Sensory Research
  284. Syracuse University
  285. bart_farell@isr.syr.edu
  286.  
  287. Mark W. Greenlee
  288. Neurologische Universitaetsklinik
  289. University of Freiburg
  290. GERMANY
  291. greenlee@sun1.ruf.uni-freiburg.de
  292.  
  293. Stevan Harnad
  294. Department of Psychology
  295. University of Southampton
  296. UK
  297. harnad@ecs.soton.ac.uk
  298.  
  299. Mary Hayhoe
  300. Center for Visual Science
  301. University of Rochester
  302. mary@cvs.rochester.edu
  303.  
  304. Alun Johns
  305. Psychology Department
  306. Oxford University
  307. UK
  308. ajohns@psy.ox.ac.uk
  309.  
  310. Keith Karn
  311. Center for Visual Science
  312. University of Rochester
  313. keith@cvs.rochester.edu
  314.  
  315. Stanley Klein
  316. School of Optometry
  317. UC Berkeley
  318. klein@adage.Berkeley.EDU
  319.  
  320. Peter Lennie
  321. Center for Visual Science
  322. University of Rochester
  323. pl@cvs.rochester.edu
  324.  
  325. Dennis Levi
  326. School of Optometry
  327. University of Houston
  328. DLevi@UH.EDU
  329.  
  330. Donald I. A. MacLeod
  331. Psychology Department
  332. University of California S.D.
  333. dmacleod@ucsd.edu
  334.  
  335. Tony Norcia
  336. Smith Kettlewell Eye Research Institute
  337. San Francisco, CA
  338. amn@skivs.ski.org
  339.  
  340. Joel Pokorny
  341. Eye Research Lab.
  342. University of Chicago
  343. s+p@chroma.uchicago.edu
  344.  
  345. Bertram O. Ploog
  346. Hunter College
  347. CUNY
  348. ploog@envmed.rochester.edu
  349.  
  350. Russell A. Poldrack            
  351. Amnesia Research Lab
  352. Beckman Institute
  353. poldrack@uiuc.edu 
  354.  
  355. Manoj Raghavan
  356. Institute for Sensory Research
  357. Syracuse University
  358. Manoj_Raghavan@isr.syr.edu
  359.  
  360. Allison B. Sekuler
  361. Psychology Department
  362. University of Toronto
  363. sekuler@psych.toronto.ca
  364.  
  365. Shui-I Shih
  366. Psychology
  367. Southampton University
  368. UK
  369. SHUI@psy.soton.ac.uk
  370.  
  371. Ben Singer
  372. Center for Visual Science
  373. U Rochester
  374. bens@cvs.rochester.edu
  375.  
  376. Vivianne C. Smith
  377. Eye Research Lab.
  378. University of Chicago
  379. s+p@chroma.uchicago.edu
  380.  
  381. Joshua Solomon
  382. Vision Group
  383. NASA Ames
  384. Joshua_Solomon@qmgate.arc.nasa.gov
  385.  
  386. Hans Strasburger
  387. Institut fuer Medizinische Psychologie
  388. University of Muenchen
  389. Germany
  390. hans@groucho.imp.med.uni-muenchen.de
  391.  
  392. Joann M. Taylor
  393. Color Technology Solutions
  394. joannt@teleport.com
  395.  
  396. Marty Wachter
  397. School of Medicine         
  398. Johns Hopkins University
  399. mrw@welchgate.welch.jhu.edu
  400.  
  401. Andrew B. Watson
  402. Vision Group
  403. NASA Ames
  404. beau@vision.arc.nasa.gov
  405.  
  406. Lan Zhang
  407. Psychology Dept.
  408. Syracuse University
  409. lzhang@mailbox.syr.edu
  410.  
  411. Yi-Xiong Zhou
  412. Center for Neural Systems
  413. NYU
  414. zhou@cns.nyu.edu
  415.  
  416. [In addition to the above 41, the following 10 people also asked
  417. to be included as signatories, but I received their replies too 
  418. late for the original letter. 3/27/95]
  419.  
  420. Lawrence K. Cormack
  421. Psychology Department
  422. University of Texas at Austin
  423. CORMACK@PSY.UTEXAS.EDU
  424.  
  425. James Dinunzio
  426. Computer Science Department
  427. USC
  428. dinunzio@scf.usc.edu
  429.  
  430. Lewis O. Harvey Jr.
  431. Department of Psychology
  432. University of Colorado
  433. lharvey@clipr.colorado.edu
  434.  
  435. Ju Li
  436. Department of Psychology
  437. Columbia University
  438. ta-jl134@columbia.edu
  439.  
  440. Mats Lind
  441. Center for Human Computer Studies
  442. Uppsala University
  443. Sweden 
  444. mats.lind@cmd.uu.se
  445.  
  446. Walter Makous
  447. Center for Visual Science
  448. University of Rochester
  449. walt@cvs.rochester.edu
  450.  
  451. David Rose
  452. Department of Psychology
  453. University of Surrey
  454. UK
  455. pss1dr@surrey.ac.uk
  456.  
  457. Stefan Treue
  458. Div. of Neuroscience
  459. Baylor College of Medicine
  460. streue@bcm.tmc.edu
  461.  
  462. Christopher Tyler
  463. Smith Kettlewell Eye Research Institute
  464. San Francisco, CA
  465. cwt@skivs.ski.org
  466.  
  467. Hugh R. Wilson
  468. Visual Science Center
  469. University of Chicago
  470. hrw6@midway.uchicago.edu
  471.  
  472. BACKGROUND--THE VIDEOTOOLBOX:
  473.  
  474. Denis Pelli uses Macs to do vision research. A '91 paper of his
  475. described a simple electronic circuit that combined the three DAC
  476. outputs of a color video card to achieve exquisitely precise grayscale
  477. images on a grayscale monitor. A recent paper, on how people see
  478. letters, was the cover article of the June '94 issue of Nature.
  479. (Reprints are available.) A paper on how we see words is currently under
  480. review at Science. Over the years since the Mac II appeared he developed
  481. a library of C software (the VideoToolbox) for doing vision research on
  482. Macs, and since '91 the complete archive has been available to the
  483. public. It is electronically available in source form from info-mac,
  484. updated several times a year, and is free for research purposes. We
  485. estimate that one hundred vision research labs worldwide are using this
  486. software, each with many Macs and students.
  487. ftp://sumex-aim.stanford.edu/info-mac/dev/src/video-toolbox-95-01-14-c.sit
  488.  
  489. The TimeVideo application included in the VideoToolbox checks out the
  490. timing of all video devices in anticipation of their use in critical
  491. real-time applications, e.g. movies or lookup table animation. It seems
  492. to be the only test program in existence for rigorous testing of Mac
  493. video drivers. It uncovered bugs in drivers from Dome, Radius,
  494. RasterOps, Relax, SuperMac, TrueVision, and Apple, including the Mac
  495. IIci "Macintosh II Built-In Video" (.Display_Video_Apple_RBV1), 4*8 and
  496. 8*24 "Macintosh Display Card" (.Display_Video_Apple_MDC), "Macintosh
  497. Display Card 8*24 GC" (.Display_Video_Apple_MDCGC), and Quadra 700, 900,
  498. and 950 (.Display_Video_Apple_DAFB versions 0 and 2). Version
  499. 3 of the .Display_Video_Apple_DAFB driver (e.g. in the Centris 650) is
  500. bug-free. All bugs have been reported to the manufacturers. We're happy
  501. to report that all of Apple's new drivers published in the last several
  502. years are bug free. Perhaps the driver-design teams have added TimeVideo
  503. to their testing suite.
  504. ftp://sumex-aim.stanford.edu/info-mac/Configuration/time-video-363.sit
  505.  
  506. Pelli, D. G. and Zhang, L. (1991) Accurate control of contrast on
  507. microcomputer displays. Vision Research, 31, 1337-1350.
  508.  
  509. Solomon, J. A. and Pelli, D. G. (1994) The visual filter mediating
  510. letter identification. Nature, 369 (6479), 395-397.
  511.  
  512. Pelli, D. G., Farell, B., and Moore, D. C. (1995) The role of letters in
  513. recognizing words. Under review at Science.
  514.  
  515. Burns, C. W., Pelli, D. G., Farell, B., and Moore, D. C. (1995)
  516. Identifying letters. Submitted to Vision Research.
  517.  
  518. TYPOS:
  519.  
  520. In the "Display Driver Calls" chapter of interim-release "Designing PCI Cards &
  521.  Drivers" on the MacOS SDK #2.
  522. p. 161 "Too improve ..."
  523. p. 163 "... 32-bit address#."
  524. p. 163 "lumimance"
  525. p. 163 "luminnace-"
  526. p. 167 "The Display Manager. also ..."
  527.  
  528. Incidentally, the "Display Driver Calls" chapter would be easier to use
  529. if it were a complete document, not requiring reference to the old 68k
  530. "Designing Cards & Drivers".
  531.  
  532. ACKNOWLEDGEMENTS:
  533.  
  534. Thanks to Mike Landy for help with the timing specs.
  535.  
  536. ======================================================================
  537.  
  538.